<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../vue.js"></script>
</head>

<body>
  <div id="app">
    {{username}}-{{age}}-{{address}}
  </div>

  <script>

    var user = {
      username: 'liuhuihui',
      age: 18,
      address: ""
    }


    // Object.freeze(user)

    var vm = new Vue({
      el: '#app',
      data: user,
      myoptions() {
        console.log()
      }

    })

    // vm.address = "beijing"

    vm.$watch('username', function (newval, oldval) {
      console.log(newval, oldval)
    })

  </script>


</body>

</html>